home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / thor12.zip / CEDPGPSC.LHA / CEDPGPScripts / CEDPGP next >
AmigaDOS Script File  |  1993-12-16  |  2KB  |  80 lines

  1. .key Editor/a,Filename/a
  2. .bra {
  3. .ket }
  4.  
  5. set width 72
  6.  
  7. failat 99
  8.  
  9. search "{filename}" "-----BEGIN PGP MESSAGE-----"
  10. if NOT WARN
  11.      set Msgfile `list "{Filename}" lformat="%s"`
  12.      QuoteMsg "{filename}" "t:$Msgfile" $width UNQUOTE
  13.      copy "t:$Msgfile" "{filename}.bak"
  14.      if not exists ENV:PGPPASS
  15.           setenv PGPPASS "`ESR "" "Enter PGP password:"`"
  16.      endif
  17.      delete {filename}
  18.      path $PGPPATH add
  19.     pgp >>t:out.$Msgfile t:$Msgfile -o {filename}
  20.      if WARN
  21.           copy "{filename}.bak" "{filename}"
  22.           type >"CON:0/10//200/PGP Error Msg/CLOSE/WAIT/ScreenTHOR" "t:out.$Msgfile"
  23.          delete >nil: "t:$Msgfile" "t:out.$Msgfile" "{filename}.bak"
  24.           skip edit
  25.           endif
  26.      setenv CEDPGP.$Msgfile 1
  27.     QuoteMsg "{filename}" "t:$Msgfile" $width
  28.      assign >nil: exists THOR:
  29.      if NOT WARN
  30.           THOR:bin/AddSig "t:$Msgfile"
  31.           endif
  32.      copy "t:$Msgfile" "{filename}"
  33.     delete >nil: "t:$Msgfile" "t:out.$Msgfile" "{filename}.bak"
  34.      endif
  35.  
  36. lab edit
  37.  
  38. "{editor}" -sticky "{filename}"
  39.  
  40. if exists ENV:CEDPGP.$Msgfile
  41.      search "{filename}" "-=-=-=-=-=-DO NOT PGPCRYPT!-=-=-=-=-=-"
  42.      if WARN
  43.           skip crypt
  44.           endif
  45.      grep >"t:$Msgfile" -v "PGPCRYPT!" "{filename}"
  46.      copy "t:$Msgfile" "{filename}"
  47.      unsetenv CEDPGP.$Msgfile
  48.      delete t:$Msgfile
  49.      skip quit
  50.      endif
  51.  
  52. search "{filename}" "-=-=-=-=-=-    PGPCRYPT!   -=-=-=-=-=-"
  53. if not WARN
  54.      skip crypt
  55.      endif
  56.  
  57. skip quit
  58.  
  59. lab crypt
  60.  
  61. if exists ENV:CEDPGP.$Msgfile
  62.       grep >"t:$Msgfile" -v "PGPCRYPT!" "{filename}"
  63.       copy "t:$Msgfile" "{filename}"
  64.       endif
  65. if not exists ENV:PGPPASS
  66.      setenv PGPPASS "`ESR "" "Enter PGP password:"`"
  67.      endif
  68. path $PGPPATH add
  69. pgp >>"t:out.$Msgfile" -o "t:$Msgfile" -eas "{filename}" "`ESR "" "Who is the PGP message for?"`"
  70. if WARN
  71.      type >"CON:0/10//200/PGP Error Msg/CLOSE/WAIT/ScreenTHOR" "t:out.$Msgfile"
  72.      copy "{filename}" "t:$Msgfile.asc"
  73.      endif
  74. copy "t:$Msgfile.asc" "{filename}"
  75. delete "t:$Msgfile" "t:$Msgfile.asc" "t:out.$Msgfile"
  76. unsetenv CEDPGP.$Msgfile
  77. unset Msgfile
  78.  
  79. lab quit
  80.